package com.nuoniu.sibanyun.service.crm.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.nuoniu.sibanyun.entity.crm.CrmWebImg;
import com.nuoniu.sibanyun.mapper.crm.CrmWebImgMapper;
import com.nuoniu.sibanyun.service.crm.ICrmWebImgService;
import com.nuoniu.sibanyun.userThread.UserInfo;
import com.nuoniu.sibanyun.userThread.UserThreadLocal;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 网站图片配置 服务实现类
 * </p>
 *
 * @author baiqiang
 * @since 2020-07-25
 */
@Service
public class CrmWebImgServiceImpl extends ServiceImpl<CrmWebImgMapper, CrmWebImg> implements ICrmWebImgService {

    @Override
    public Page<CrmWebImg> webImageList(Page pages, CrmWebImg webImg) {
        CrmWebImg crmWebImg = new CrmWebImg();
        QueryWrapper<CrmWebImg> queryWrapper = new QueryWrapper<>(crmWebImg);
        queryWrapper.eq("status", 0);
        queryWrapper.orderByDesc("create_date");
        return page(pages, queryWrapper);
    }

    @Override
    public List<CrmWebImg> loginImg() {
        CrmWebImg crmWebImgQuery = new CrmWebImg();
        crmWebImgQuery.setType(0);
        QueryWrapper<CrmWebImg> queryWrapper = new QueryWrapper<>(crmWebImgQuery);
        List<CrmWebImg> loginImgs = list(queryWrapper);
        return loginImgs;
    }
}
